package com.alipay.service;


import com.alipay.model.dto.TransDto;
import com.alipay.exception.BalanceException;
import com.alipay.exception.RiskAccountException;

/**
 * @author Jun
 */
public interface AccountService {
    /**
     * 签名验证，简单实现
     *
     * @param sign
     * @param transferInfo
     * @return
     */
    boolean signCheck(String sign, String transferInfo);

    /**
     * 扣减A的余额
     *
     * @param transDto
     * @return
     * @throws BalanceException
     */
    boolean decrease(TransDto transDto) throws BalanceException;

    /**
     * 增加B的余额
     *
     * @param transDto
     * @return
     * @throws RiskAccountException
     */
    boolean increase(TransDto transDto) throws RiskAccountException;

    /**
     * B业务异常时回冲A的余额
     *
     * @param transDto
     * @return
     */
    boolean revertDecrease(TransDto transDto);
}
